<template>
    <div class="data">
      <van-nav-bar title="本周统计" />
      <div ref="echartsRef" class="echart"></div>
      <van-nav-bar title="测温日志" />
      <van-empty description="描述文字" />
    </div>

</template>

<script setup>
import { ref, onMounted, } from 'vue';
import * as echarts from 'echarts'
import request from '../utils/request'


const echartsRef = ref(null)

const initChart = function(){
  let myChart = echarts.init(echartsRef.value)
  let option = {
    title: {
      text: '温度计测量数据统计'
    },
    tooltip: {
      trigger:'axis',
      axisPinter:{
        type:'line',
      }
    },
    xAxis: {
      type: 'category',
      data: ['日', '一', '二', '三', '四', '五', '六']
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        type: 'line',
        smooth: true,
        data: [36.2, 36.7, 36.3, 36.5, 36.9, 36.5, 36.2],
      }
    ]
  }
  myChart.setOption(option)
}

onMounted(() => {
  initChart()
})

</script>
<style scoped>
  .echart{
    width: auto;
    height: 400px;
    margin-top: 10px;
  }
</style>
